import request from '@/utils/request'

/**
 *获取列表的角色
 * @param {*} page
 * @param {*} pagesize
 * @returns
 */
export const getsettingApi = (from) => {
  return request.get('/sys/role', { params: from })
}

/**
 *删除的接口
 * @param {*} id
 * @returns
 */
export const delsettingApi = (id) => {
  return request.delete(`/sys/role/${id}`)
}

/**
 *添加的接口
 * @param {*} form
 * @returns
 */
export const addsettingApi = (form) => {
  return request.post('/sys/role', form)
}

/**
 *获取要修改的详情
 * @param {*} id
 * @returns
 */
export const xiusettingApi = (id) => {
  return request.get(`/sys/role/${id}`)
}

/**
 *修改的方法
 * @param {*} form
 * @returns
 */
export const putsettingApi = (form) => {
  return request.put(`/sys/role/${form.id}`, form)
}

/**
 * 获取当前公司的信息
 * @param {*} id
 * @returns
 */
export const getgongsi = (id) => {
  return request.get(`/company/${id}`)
}

/**
 * 给角色分配权限
 * @param {*} data 所需参数
 * @returns
 */
export const assignPermApi = data => {
  return request({
    url: '/sys/role/assignPrem',
    method: 'put',
    data
  })
}
